#import <UIKit/UIKit.h>

#undef ABS
#undef MIN
#undef MAX

#include "mupdf/fitz.h"

#import "NVAOutlineController.h"
#import "NVADocRef.h"
#import "NVADialogCreator.h"
#import "NVAUpdater.h"
#import "NVAPrintf.h"
#import "NVASettingController.h"
#import "SelectTextDelegate.h"
enum
{
	BARMODE_MAIN,
	BARMODE_SEARCH,
	BARMODE_MORE,
	//BARMODE_ANNOTATION,
    //BARMODE_COPY,
	BARMODE_HIGHLIGHT,
	//BARMODE_UNDERLINE,
	//BARMODE_STRIKE,
	BARMODE_INK,
	BARMODE_DELETE
};

@interface NVADocumentController : UIViewController <UIScrollViewDelegate, UIGestureRecognizerDelegate, UISearchBarDelegate, NVADialogCreator, NVAUpdater,SelectTextDelegate>
{
	fz_document *doc;
	NVADocRef *docRef;
	NSString *key;
	char *filePath;
	BOOL reflowMode;
	NVAOutlineController *outline;
	UIScrollView *canvas;
	UILabel *indicator;
	UISlider *slider;
	UISearchBar *searchBar;
	UIBarButtonItem *nextButton, *prevButton, *cancelButton, *searchButton, *outlineButton, *linkButton;
	UIBarButtonItem *moreButton;
    UIBarButtonItem *shareButton, *printButton;//, *annotButton;
	UIBarButtonItem *highlightButton;//, *underlineButton, *strikeoutButton,*copybutton;
	UIBarButtonItem *inkButton;
	UIBarButtonItem *tickButton;
	UIBarButtonItem *deleteButton;
	UIBarButtonItem *reflowButton;
	UIBarButtonItem *backButton;
	UIBarButtonItem *sliderWrapper;
    UIBarButtonItem *setting;
	int barmode;
	int searchPage;
	int cancelSearch;
	int showLinks;
	int width; // current screen size
	int height;
	int current; // currently visible page
	int scroll_animating; // stop view updates during scrolling animations
	float scale; // scale applied to views (only used in reflow mode)
    BOOL isTextModeOn;
}
- (id) initWithFilename: (NSString*)nsfilename path:(char *)cstr document:(NVADocRef *)aDoc;
- (void) createPageView: (int)number;
- (void) gotoPage: (int)number animated: (BOOL)animated;
- (void) onShowOutline: (id)sender;
- (void) onShowSearch: (id)sender;
- (void) onCancel: (id)sender;
- (void) resetSearch;
- (void) showSearchResults: (int)count forPage: (int)number;
- (void) onSlide: (id)sender;
- (void) onTap: (UITapGestureRecognizer*)sender;
- (void) showNavigationBar;
- (void) hideNavigationBar;
- (void) showMoreMenu;
@end
